<template>
  <div
    class="all"
    :style="{ height: screenHeight + 'px', width: screenWidth + 'px' }"
  >
    <Return txt="AI团队" style="background: #eeeeee"></Return>
    <!-- <div class="top">
      <van-icon name="arrow-left" @click="returnTap" />
      <span>AI团队</span>
      <van-icon name="ellipsis" />
    </div> -->
    <div class="time">上午 9:30</div>
    <div>
      <div class="messageleft">
        <img
          @click="mineTap"
          class="messageleftimg1"
          src="../../../assets/images/logo.png"
          alt=""
        />
        <div class="messagerghtText">我有意见</div>
      </div>
      <div class="messageright">
        <img
          @click="peoplemoreTap"
          class="messageleftimg1"
          src="../../../assets/images/logo.png"
          alt=""
        />
        <div class="messageleftText">
          你好，如果你有任何建议或投诉，请点击<span
            style="color: #737c97"
            @click="adviceTap"
            >此处</span
          >反馈给我们，谢谢
        </div>
      </div>
    </div>
    <div class="button" v-if="isshow">
      <div class="icon1" @click="isshow = false">
        <van-icon name="revoke" />
      </div>
      <div class="buttonText" @click="adviceTap">意见 反馈</div>
    </div>
    <div class="buttonall" v-if="!isshow">
      <div class="button1">
        <div class="icon1" @click="isshow = true">
          <van-icon name="revoke" />
        </div>
        <div class="icon1">
          <van-icon name="volume-o" />
        </div>
        <input type="text" class="button_input" />
        <div class="icon1">
          <van-icon name="smile-o" />
        </div>
        <div class="icon1">
          <van-icon name="add-o" />
        </div>
      </div>
      <div class="buList">
        <div class="buList1" @click="fileClick()">
          <div class="buListicon"><van-icon name="photo" /></div>
          <span>照片</span>
        </div>
        <div class="buList1" @click="videoTap()">
          <div class="buListicon"><van-icon name="photo-fail" /></div>
          <span>拍摄</span>
        </div>
        <input
          type="file"
          id="video_file"
          class="input_img"
          style="display: none"
          accept="image/*"
          @change="getImg($event, index)"
        />
        <input
          id="upload_file"
          type="file"
          style="display: none"
          accept="image/*"
          name="file"
          @change="fileChange($event)"
        />
        <div class="buList1" @click="show = true">
          <div class="buListicon"><van-icon name="location" /></div>
          <span>位置</span>
        </div>
        <div class="buList1" @click="shoucangTap">
          <div class="buListicon"><van-icon name="star" /></div>
          <span>收藏</span>
        </div>
        <div class="buList1" @click="gerenTap">
          <div class="buListicon"><van-icon name="manager" /></div>
          <span>个人名片</span>
        </div>
      </div>
    </div>
    <van-overlay
      :show="show"
      @click="show = false"
      style="background: rgba(30, 30, 30, 0.5)"
    >
      <div class="wrapper" @click.stop>
        <div class="block">
          <div class="blockOne" @click="fasongTap">发送位置</div>
          <div class="blockOne block1" @click="gongxiangTap">共享实时位置</div>
          <div class="blockOne" @click="show = false">取消</div>
        </div>
      </div>
    </van-overlay>
  </div>
</template>
<script>
import Return from "../../../components/return";
export default {
  components: {
    Return,
  },
  data() {
    return {
      screenWidth: window.innerWidth,
      screenHeight: window.innerHeight,
      isshow: true,
      show:false
    };
  },
  methods: {
        shoucangTap() {
      this.$router.push("/shoucang");
    },
    fileClick() {
      $("#upload_file").click();
    },
    videoTap() {
      $("#video_file").click();
    },
    fileChange(el) {
      this.files = $("#upload_file").get(0).files;
      console.log(this.files.length);
      for (let i = 0; i < this.files.length; i++) {
        this.datas.append("file", this.files[i]);
      }
      this.show1 = false;
      console.log(typeof this.files);
      console.log(this.files);
      if (!el.target.files[0].size) return;
      this.fileList(el.target);
      el.target.value = "";
    },
    // 调用摄像头权限
    getImg(event, index) {
      let that = this;

      let files = event.target.files[0];

      //创建读取文件的对象
      var file = new FileReader(); //文件读取
      //分析文件对象
      file.readAsDataURL(files);
      //文件加载成功
      file.onload = function (e) {
        console.log("这是======》", this.result); /*获取bese路径*/
        if (/image/.test(this.result)) {
          //或者 e.targin.result
          console.log("ndfnfn");

          that.listImg[index].imgsrc = this.result;
          //  that.$set(that.list,index,that.list[index])
          //  console.log(that.list)
        }
      };
    },
    returnTap() {
      this.$router.go(-1);
    },
    nextTap() {
      this.$router.push("/messageall");
    },
    peoplemoreTap() {
      this.$router.push("/head");
    },
    mineTap() {
      this.$router.push("/headmine");
    },
    adviceTap() {
      this.$router.push("/msgadvice");
    },
    gerenTap() {
      this.$router.push("/qunliao");
    },
    wenjianTap() {
      this.$router.push({ path: "/shoucangmore", query: { type: 3 } });
    },
        fasongTap() {
      this.$router.push("/address");
    },
    gongxiangTap() {
      this.$router.push("/addressA");
    },
  },
};
</script>
<style scoped>
.all {
  background: #eeeeee;
}
.top {
  height: 60px;
  width: 90%;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 60px;
  position: relative;
  background: #eeeeee;
}
.button {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  background: #e1e0e1;
  border-top: 1px solid #ccc;
}
.buttonall {
  position: fixed;
  bottom: 0;
  left: 0;
  height: auto;
  width: 100%;

  border-top: 1px solid #ccc;
}
.button1 {
  height: 60px;
  display: flex;
  align-items: center;
  background: #e1e0e1;
}
.icon1 {
  width: 12%;
  text-align: center;
  font-size: 28px;
}
.button_input {
  width: 52%;
  height: 40px;
  border: none;
  border-radius: 5px;
}
.messageleft {
  height: auto;
  display: flex;
  width: 94%;
  margin-left: 3%;
  justify-content: right;
  flex-direction: row-reverse;
  margin-top: 10px;
}
.messageright {
  height: auto;
  display: flex;
  width: 84%;
  margin-left: 3%;
  justify-content: right;
  margin-top: 10px;
}
.messageright .messageleftimg2 {
  margin-left: 10px;
}
.messageleftimg2 {
  width: auto;
  height: 100px;
  border-radius: 5px;
  margin-right: 10px;
}
.messageleftimg1 {
  width: 50px;
  height: 50px;
  border-radius: 5px;
}
.messagerghtText {
  height: 40px;
  background: #fff;
  line-height: 40px;
  border-radius: 5px;
  padding: 0 10px;
  margin-right: 10px;
  margin-top: 5px;
  background: #98ea69;
}
.messageleftText {
  height: auto;
  background: #fff;
  line-height: 30px;
  border-radius: 5px;
  padding: 0 10px;
  margin-left: 10px;
  margin-top: 3px;
}
.time {
  font-size: 15px;
  text-align: center;
  margin: 10px 0;
  color: #b5b5b5;
}
.buttonText {
  width: 88%;
  text-align: center;
  font-size: 22px;
  height: 40px;
  line-height: 40px;
  border-left: 1px solid #d3d3d3;
}
.buList {
  height: 300px;
  width: 100%;
  background: #f5f5f5;
  display: flex;
  flex-wrap: wrap;
}
.buList1 {
  width: 25%;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.buListicon {
  width: 80px;
  height: 80px;
  background: #ffffff;
  text-align: center;
  align-items: center;
  font-size: 30px;
  line-height: 80px;
}
.block {
  height: 215px;
  width: 100%;
  position: fixed;
  right: 0px;
  bottom: 0px;
  z-index: 100;
  background: rgba(255, 255, 255, 1);
  border-radius: 5px;
  z-index: 999;
}
.blockOne {
  height: 68px;
  width: 100%;
  text-align: center;
  line-height: 68px;
}
</style>